package com.insigma.business.qrcode.soldier.controller;

import com.insigma.business.qrcode.common.annotation.ApiServiceType;
import com.insigma.business.qrcode.common.template.BasePagingResponse;
import com.insigma.business.qrcode.common.vo.BaseDeleteRequest;
import com.insigma.business.qrcode.common.vo.BaseResponse;
import com.insigma.business.qrcode.job._bff.TrainBFFProvider;
import com.insigma.business.qrcode.job.dto.TrainingVideoDTO;
import com.insigma.business.qrcode.job.dto.request.TrainingVideoInsertRequest;
import com.insigma.business.qrcode.job.dto.request.TrainingVideoSearchRequest;
import com.insigma.business.qrcode.job.dto.request.TrainingVideoUpdateRequest;
import com.insigma.business.qrcode.soldier.request.BaseGetRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Api(value = "老兵 码上知识库")
@RequestMapping("/web/soldierTraining")
@RestController("soldierTrainingController")
public class SoldierTrainingController {

    @Resource
    TrainBFFProvider trainBFFProvider;

    @PostMapping("/searchTrainingVideo")
    @ApiOperation("查询培训视频数据列表")
    public BasePagingResponse<List<TrainingVideoDTO>> searchTrainingVideo(@RequestBody TrainingVideoSearchRequest trainingVideoSearchRequest){
        return trainBFFProvider.searchTrainingVideo(trainingVideoSearchRequest);
    }

    @PostMapping("/getTrainingVideo")
    @ApiOperation("查询单条培训数据")
    public BaseResponse<TrainingVideoDTO> getTrainingVideo(@RequestBody BaseGetRequest baseGetRequest){
        return trainBFFProvider.getTrainingVideo(baseGetRequest);
    }

    @PostMapping("/insertTrainingVideo")
    @ApiOperation("新增培训视频")
    public BaseResponse<String> insertTrainingVideo(@RequestBody TrainingVideoInsertRequest trainingVideoInsertRequest){
        return trainBFFProvider.insertTrainingVideo(trainingVideoInsertRequest);
    }

    @PostMapping("/updateTrainingVideo")
    @ApiOperation("更新培训视频")
    public BaseResponse<Integer> updateTrainingVideo(@RequestBody TrainingVideoUpdateRequest trainingVideoUpdateRequest){
        return trainBFFProvider.updateTrainingVideo(trainingVideoUpdateRequest);
    }


    @PostMapping("/publishTrainingVideo")
    @ApiOperation("发布培训视频")
    public BaseResponse<Integer> publishTrainingVideo(@RequestBody TrainingVideoUpdateRequest trainingVideoUpdateRequest){
        return trainBFFProvider.publishTrainingVideo(trainingVideoUpdateRequest);
    }

    @PostMapping("/topTrainingVideo")
    @ApiOperation("置顶培训视频")
    public BaseResponse<Integer> topTrainingVideo(@RequestBody TrainingVideoUpdateRequest trainingVideoUpdateRequest){
        return trainBFFProvider.topTrainingVideo(trainingVideoUpdateRequest);
    }

    @PostMapping("/collectTrainingVideo")
    @ApiOperation("收藏培训视频")
    public BaseResponse<Integer> collectTrainingVideo(@RequestBody TrainingVideoUpdateRequest trainingVideoUpdateRequest){
        return trainBFFProvider.collectTrainingVideo(trainingVideoUpdateRequest);
    }

    @PostMapping("/deleteTrainingVideo")
    @ApiOperation("删除培训视频")
    public BaseResponse<Integer> deleteTrainingVideo(@RequestBody BaseDeleteRequest deleteRequest){
        return trainBFFProvider.deleteTrainingVideo(deleteRequest);
    }


}
